<template>
  <div class="dashboard-chart-bar" ref="bar"></div>
</template>

<script>
import * as echarts from 'echarts'
import resize from '@/mixin/resize'

export default {
  name: 'ChartBar',
  mixins: [resize],
  mounted() {
    const myEcharts = echarts.init(this.$refs.bar)
    myEcharts.setOption({
      xAxis: {
        data: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
        show: false
      },
      yAxis: {
        show: false
      },
      series: {
        type: 'bar',
        data: [
          120,
          100,
          40,
          130,
          180,
          110,
          30,
          70,
          100,
          60,
          190,
          160,
          140,
          90,
          20,
          40
        ]
      },
      grid: {
        top: 0,
        bottom: 0,
        left: 0,
        right: 0
      }
    })
    this.myEcharts = myEcharts
  }
}
</script>

<style lang="scss" scoped>
.dashboard-chart-bar {
  width: 100%;
  height: 100%;
}
</style>
